import {l3ChartData} from "./data.js";
import {Radar} from "@antv/g2plot";

let chartInstance = null;

export const createChartL3 = (el, type) => {
  if (chartInstance) {
    chartInstance?.destroy();
  }
  chartInstance = new Radar(el, {
    data: l3ChartData.value,
    xField: "title",
    yField: "value",
    padding: [20, 0, 0, 0],
    xAxis: {
      label: null,
      line: {
        style: {
          stroke: "#024C7A",
        },
      },
      grid: {
        line: {
          style: {
            stroke: "#024C7A",
          },
        },
      },
      tickLine: null,
    },
    yAxis: {
      label: null,
      line: {
        style: {
          stroke: "#024C7A",
        },
      },
      grid: {
        line: {
          style: {
            stroke: "#024C7A",
          },
        },
      },
      min: 0,
    },
    point: {
      size: 2,
    },
    tooltip: false,
    area: {},
  });
  chartInstance.render();
};
